﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkCheck.aspx.cs" Inherits="ZX.WebApp.TR.WorkCheck" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
    </style>
    <script  language="javascript" type="text/javascript">
        //限制输入字数
        function MaxText(obj, max) {
            if (obj.value.length > max) {
                alert("最多可输入" + max + "个字");
                obj.value = obj.value.substr(0, max);
            }
        }
        function $(id) { return document.getElementById(id) }
        function Save() {
            var check = $("TaCheck");
            if (check.value == "") {
                alert("请填写【点评】");
                check.focus();
                return false;
            }
            else {
                var id = $("hdfcheckid").value;
                var co = replaceAll($("TaCheck").value, "|", "");
                var us = $("hdfAddUser").value;
                var back = ZX.WebApp.TR.WorkCheck.SaveCheck(queryString("TYPE") + "|" + queryString("WPID") + "|" + co + "|" + us + "|" + id).value;
                if (back == "1") {
                    alert("保存成功！");
                    parent.closeWin();
                }
                else
                    alert("保存失败");
            }
        }
        //替换所有
        //s1原始字符串
        //s2子字符串
        //s3子字符串要替换成的值
        function replaceAll(s1, s2, s3) {
            var r = new RegExp(s2.replace(/([\(\)\[\]\{\}\^\$\+\-\*\?\.\"\'\|\/\\])/g, "\\$1"), "ig");
            return s1.replace(r, s3);
        }
        //只取一个URL参数：
        var queryString = function (key) {
            return (document.location.search.match(new RegExp("(?:^\\?|&)" + key + "=(.*?)(?=&|$)")) || ['', null])[1];
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table>
    <tr>
        <td>
            点评
        </td>
        <td  ><asp:HiddenField runat="server" ID="hdfcheckid"/>
            <textarea id="TaCheck" onkeypress="return MaxText(this,500);" cols="40" rows="10" onmouseover="return MaxText(this,500);"  runat="server"  ></textarea>
        </td>
        </tr>
        <tr>
        <td>&nbsp;</td><td></td>
        </tr>
        <tr>
            
        <td>
            点评人
        </td>
        <td><asp:HiddenField runat="server" ID="hdfAddUser"/>
            <asp:Label ID="LabAddUser" runat="server" Text=""></asp:Label>
        </td>
        </tr>
        <tr>
        <td>
        时间
        </td>
        <td>
            <asp:Label ID="LabAddTime" runat="server" Text=""></asp:Label>
        </td>
    </tr>
    </table>
    </div>
    </form>
</body>
</html>
